package tyk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import tyk.common.Result;
import tyk.vo.UserVo;
import tyk.pojo.User;
import tyk.service.UserService;

@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private UserService userService;

    /*
    * 用户登录
    * */
    @PostMapping("/login")
    public Result<UserVo> login(@RequestBody User user) {
        return Result.success(userService.login(user));
    }

    /*
    * 用户退出
    * */
    @GetMapping("/logout")
    public Result<String> logout() {
        return Result.success(null);
    }



}
